using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using kxcxw.Data.Entities;

namespace kxcxw.Data.Mapping
{
	public class SysUserProfileMap : EntityTypeConfiguration<SysUserProfile>
	{
		public SysUserProfileMap()
		{
			// Primary Key
			this.HasKey(t => t.UserID);

			// Properties
			this.Property(t => t.UserID)
				.IsRequired()
				.HasMaxLength(36);
				
			// Table & Column Mappings
			this.ToTable("SysUserProfile");
			this.Property(t => t.UserID).HasColumnName("UserID");

			// Relationships
			this.HasRequired(t => t.SysUserInfo)
				.WithOptional(t => t.SysUserProfile);
				
		}
	}
}

